package com.wk.springframework.support;

import com.wk.springframework.config.BeanDefinition;

/**
 * 很有能力的一个bean工厂哦
 */
public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFactory{

    @Override
    protected Object createBean(String beanName, BeanDefinition beanDefinition) {
        Object obj;
        try {
            obj = beanDefinition.getBeanClass().newInstance();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        addSingleton(beanName,obj);
        return obj;
    }
}
